package com.sz.framework.base;

import android.app.Application;

import com.blankj.utilcode.util.LogUtils;
import com.blankj.utilcode.util.Utils;
import com.sz.framework.BuildConfig;

public class BaseApplication extends Application {
    private static Application app;

    @Override
    public void onCreate() {
        super.onCreate();
        app = this;
        Utils.init(this);
        initLog();
    }

    /**
     * 初始化日志
     */
    private void initLog() {
        LogUtils.Config config = LogUtils.getConfig()
                // 设置 log 总开关，包括输出到控制台和文件，默认开
                .setLogSwitch(BuildConfig.DEBUG)
                // 设置是否输出到控制台开关，默认开
                .setConsoleSwitch(BuildConfig.DEBUG)
                .setBorderSwitch(false);
        LogUtils.d(config.toString());
    }

    public static Application getApp() {
        return app;
    }
}
